﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Web.UI;
using SME.Food.Surperise.BLL;
using System.Data;
using System.Web.UI.WebControls;

namespace SME.Food.Tricon.Web.AdminJS.DishesManage
{
    public partial class DishesList : System.Web.UI.Page
    {
        private Bas_Dishes_BLL bll = new Bas_Dishes_BLL();
        public  string orderids = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request.QueryString["type"];
            
            GetSingleSearch();
            BindData();
        }

        public void GetSingleSearch()
        {
            SearchDishesName = Request.Form["SearchDishesName"];
            SearchDishesNo = Request.Form["SearchDishesNo"];
            DishesStuta = Request.Form["DishesStuta"];
        }

        public void BindData()
        {
            StringBuilder sqlWhere = new StringBuilder();
            if (!string.IsNullOrEmpty(SearchDishesName))
            {
                sqlWhere.AppendFormat(" and Dishes_Name like '%{0}%'", SearchDishesName);
            }
            if (!string.IsNullOrEmpty(DishesStuta))
            {
                sqlWhere.AppendFormat(" and Dishes_statue={0}", Int32.Parse(DishesStuta));
            }
            if (!string.IsNullOrEmpty(SearchDishesNo))
            {
                sqlWhere.AppendFormat(" and Dishes_No like '%{0}%'", SearchDishesNo);
            }

            Table = bll.GetList(sqlWhere.ToString()).Tables[0];

        }
       

        /// <summary>
        /// 员工姓名检索
        /// </summary>
        public string SearchDishesName { get; set; }
        /// <summary>
        /// 企业编号
        /// </summary>
        public string SearchDishesNo { get; set; }

        public string DishesStuta { get; set; }


        /// <summary>
        /// 是否到期
        /// </summary>
        public string PageNum { get; set; }
        /// <summary>
        /// 企业编号
        /// </summary>
        public string NumPerPage { get; set; }
        /// <summary>
        /// 企业名称
        /// </summary>
        public DataTable Table { get; set; }
    }
}